//
//  RootViewController.m
//  Express
//
//  Created by lanou on 16/1/8.
//  Copyright © 2016年 FJY. All rights reserved.
//

#import "RootViewController.h"
#import "BaseHeader.h"

@interface RootViewController ()

@end

@implementation RootViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    QueryViewController *queryVC = [[QueryViewController alloc] init];
    ExpressSendingTableViewController *expressSendingTVC = [[ExpressSendingTableViewController alloc] initWithStyle:(UITableViewStylePlain)];
    MyExpressTableViewController *myExpress = [[MyExpressTableViewController alloc] initWithStyle:(UITableViewStylePlain)];
    
    [self addChildViewController:queryVC title:@"查询" imageString:@"query_icon@2x"];
    [self addChildViewController:expressSendingTVC title:@"寄快递" imageString:@"expressPerson_icon@2x"];
    [self addChildViewController:myExpress title:@"我的快递" imageString:@"my_icon@2x"];
    
    
}

- (void)addChildViewController:(UIViewController *)childController title:(NSString *)title imageString:(NSString *)imageString {
    UINavigationController *navigationC = [[UINavigationController alloc] initWithRootViewController:childController];
    navigationC.tabBarItem.title = title;
    childController.navigationItem.title = title;
    navigationC.tabBarItem.image = [[UIImage imageNamed:imageString] imageWithRenderingMode:(UIImageRenderingModeAlwaysOriginal)];
    childController.tabBarItem.title = title;
    [self addChildViewController:navigationC];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
